home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / wtjmarch.zip / DDEBMP.ZIP / FILEBMP.TXT < prev   
Text File  |  1991-12-18  |  2KB  |  67 lines

  1. Sub Drive1_Change ()
  2.    'User selected new disk drive...tell the dir control
  3.    Dir1.Path = Drive1.Drive
  4. End Sub
  5.  
  6. Sub Dir1_Change ()
  7.    ' User selected a new directory...tell the FileList control
  8.    FileList.Path = Dir1.Path
  9. End Sub
  10.  
  11. Sub Form_Load ()
  12.    FileList.Pattern = "*.BMP"   ' Only see BMP files
  13.    '
  14.    ' Setup to be a server with the topic DDE
  15.    LinkTopic = "DDE"
  16.    LinkMode = 1
  17. End Sub
  18.  
  19. Sub Form_LinkClose ()
  20.    ' The DDE link closed so disappear
  21.    End
  22. End Sub
  23.  
  24. Sub FileList_DblClick ()
  25.    ' User has specifically selected a new file...
  26.    ' grab the new BMP and put it in the picture control
  27.    FNameUpdate
  28. End Sub
  29.  
  30. Sub FNameUpdate ()
  31.    ' Either the user or the DDE link updated the filename...
  32.    ' so update the (hidden) fname control caption with...
  33.    ' the new name and grab the BMP into the picture
  34.    FName.Caption = Dir1.Path + "\" + FileList.FileName
  35.    BMP.Picture = LoadPicture(FName.Caption)
  36. End Sub
  37.  
  38. Sub Form_LinkExecute (CmdStr As String, Cancel As Integer)
  39.    ' The DDE client asked for the next BMP file in the...
  40.    ' directory. Since that is the only possible command...
  41.    ' there is no need to check the CmdStr
  42.    Cancel = 0  ' Tell the client okay
  43.    '
  44.    ' Check to make sure there are files to work with...
  45.    ' and then move to the next one, wrapping to the...
  46.    ' beginning of the list when at the end
  47.    If (FileList.ListCount <> 0) Then
  48.       If (FileList.ListIndex < FileList.ListCount - 1) Then
  49.          FileList.ListIndex = FileList.ListIndex + 1
  50.       Else
  51.          FileList.ListIndex = 0
  52.       End If
  53.       FNameUpdate
  54.    End If
  55. End Sub
  56.  
  57. Sub FileList_PathChange ()
  58.    ' User has changed the path for the file list...
  59.    ' update the index and count and grab a new BMP if there
  60.    ' is one in the directory
  61.    If (FileList.ListCount <> 0) Then
  62.       FileList.ListIndex = 0
  63.       FNameUpdate
  64.    End If
  65.  End Sub
  66.  
  67.